package com.prs.crm.dao.project;

import java.util.Collection;

import com.prs.crm.dao.BaseDao;
import com.prs.crm.domain.hr.Person;
import com.prs.crm.domain.project.Project;
import com.prs.crm.domain.project.Task;
import com.prs.crm.domain.project.TaskAttach;
import com.prs.crm.domain.project.TaskCritique;

public interface TaskDao extends BaseDao<Task>{
	
	void saveTaskAttach(TaskAttach attach);
	
	int batchRemoveAttachs(Integer[] attachIds);
	
	Collection<Task> findExecuteTask(Person person,int result);
	
	void saveCritique(TaskCritique critique);
	
	Task findRootTask(Project project);
	
	Collection<Task> findRootTasks(Integer[] projectIds);
	
	int updateProjectTaskStatus(Project project,Integer status,Integer flowstatus);
	
	int updateProjectTaskStatus(Project project,Integer status);
	
	/**
	 * 当前任务执行总数
	 * @param executor
	 * @return
	 */
	int countExecuteTask(Person executor);
	
	/**
	 * 当前参与任务总数
	 * @param joiner
	 * @return
	 */
	int countJoinTask(Person joiner);
	
	
	/**
	 * 当前审核任务总数
	 * @param verifyer
	 * @return
	 */
	int countVerifyTask(Person verifyer);
	
	/**
	 * 当前需提交报告的任务总数
	 * @param executor
	 * @return
	 */
	int countSumitReportTask(Person executor);
	
	
	int countInValidTask(Person executor);
	

}
